package uicgas.pump.misc;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import uicgas.tools.UicGasGeneralException;

/**
 * Class stores the configures in config.properties
 * 
 * @author Hong Wang
 *
 */
public class Config
{
	private static final Properties CONFIG = new Properties();
	static
	{
		InputStream inStream = Config.class
				.getResourceAsStream("config.properties");

		try
		{
			CONFIG.load(inStream);
		}
		catch (IOException e)
		{
			throw new UicGasGeneralException(e);
		}
	}

	public static final String SERVER_IP = CONFIG.getProperty("server.ip");

	public static final int SERVER_PORT_PUMP = Integer.parseInt(CONFIG
			.getProperty("server.port.pump"));

	public static final int SERVER_PORT_Register = Integer.parseInt(CONFIG
			.getProperty("server.port.register"));

	//	public static final int PUMP_PORT = Integer.parseInt(CONFIG
	//			.getProperty("pump.port"));

	public static final double GAS_PRICE_REGULAR = Double.parseDouble(CONFIG
			.getProperty("gas.price.regular"));
	public static final double GAS_PRICE_MIDGRADE = Double.parseDouble(CONFIG
			.getProperty("gas.price.midgrade"));
	public static final double GAS_PRICE_PREMIUM = Double.parseDouble(CONFIG
			.getProperty("gas.price.premium"));
}
